//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//#define VPNEXPORT __declspec(dllexport)
//#define VPNCALL __stdcall
//VPNEXPORT   int   VPNCALL
//CreateVPNConnection(LPCSTR sEntryName, LPCSTR sServer, LPCSTR sUsername, LPCSTR sPassword) ;
#include <Ras.h>
typedef int (__stdcall* LPFNDLLFUNC1)(LPCSTR, LPCSTR, LPRASENTRYA, LPDWORD, LPBYTE, LPDWORD );
typedef DWORD (__stdcall* LPENUMENTRY)(LPCSTR, LPCSTR, LPRASENTRYNAMEA, LPDWORD,LPDWORD );
typedef DWORD (__stdcall* LPENUMCONNECT)(LPRASCONNA, LPDWORD, LPDWORD );
typedef DWORD (__stdcall* LPGETCONNECTSTATUS)(HRASCONN, LPRASCONNSTATUSA);
typedef DWORD (__stdcall* LPGETENTRYDIALPARAMS)(LPCSTR, LPRASDIALPARAMSA, LPBOOL );
typedef DWORD (__stdcall* LPSURROGATEDIALUP)(LPRASDIALEXTENSIONS, LPCSTR, LPRASDIALPARAMSA, DWORD,LPVOID, LPHRASCONN );
typedef DWORD (__stdcall* LPRASGETERRORSTRING)(UINT, LPSTR, DWORD );
typedef DWORD (__stdcall* LPRESETDIALCONNECT)(HRASCONN, LPRASCONNSTATUSA );
typedef DWORD (__stdcall* LPRASHANGUP)( HRASCONN );
//DWORD APIENTRY RasCreatePhonebookEntryA( HWND, LPCSTR );
typedef DWORD (__stdcall* LPRasCreatePhonebookEntry)( HWND, LPCSTR );
//DWORD APIENTRY RasSetEntryPropertiesA( LPCSTR, LPCSTR, LPRASENTRYA, DWORD, LPBYTE, DWORD );
typedef DWORD (__stdcall* LPRasSetEntryProperties)( LPCSTR, LPCSTR, LPRASENTRYA, DWORD, LPBYTE, DWORD );
//DWORD APIENTRY RasSetCredentialsA( LPCSTR, LPCSTR, LPRASCREDENTIALSA, BOOL );
typedef DWORD (__stdcall* LPRasSetCredentials)( LPCSTR, LPCSTR, LPRASCREDENTIALSA, BOOL );

typedef VOID (__stdcall* LPRASDIALFUNC)(UINT, RASCONNSTATE, DWORD);

struct EntryNameInfo
{
	CHAR  szEntryName[ RAS_MaxEntryName + 1 ];
	CHAR  szUserName[ UNLEN + 1 ];
	CHAR  szPassword[ PWLEN + 1 ];
};
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
  TButton *Button1;
  TButton *Button2;
  TButton *Button3;
  TMemo *memStatus;
  TButton *Button4;
  TEdit *Edit1;
  TEdit *Edit2;
  TEdit *Edit3;
  TEdit *Edit4;
  TLabel *Label1;
  TLabel *Label2;
  TLabel *Label3;
  TLabel *Label4;
  void __fastcall Button1Click(TObject *Sender);
  void __fastcall Button2Click(TObject *Sender);
  void __fastcall Button3Click(TObject *Sender);
  void __fastcall Button4Click(TObject *Sender);
private:	// User declarations
  void __fastcall DialVPN( String FEntryName, String FUserName, String FPassword );
  BOOL   __fastcall Disconnected();
public:		// User declarations
  __fastcall TForm1(TComponent* Owner);
  RASPPPIP*   lpProjection; 
  HRASCONN hRasConn;
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
 